export interface Sample {
  id: string
  sampleNumber: string
  sampleName: string
  sampleType: string
  testingUnit: string
  mixedNumber: string | null
  samplingNumber: string | null
  operator: string | null
  operationTime: Date | null
  inputOperator?: string | null
  inputTime?: Date | null
}

// 更新后端实际返回的分页响应格式
export interface BackendPaginatedResponse<T> {
  dataList: T[]
  total: number
  page: number
  pageSize: number
  totalSamples: number
}

// 保留前端使用的分组格式（前端内部转换用）
export interface GroupedPaginatedResponse {
  groups: SampleGroup[]
  total: number
  page: number
  pageSize: number
  totalPages: number
  totalSamples: number
}

export interface SampleFilters {
  search?: string
  status?: "all" | "unassigned" | "mixed-only" | "complete"
  startDate?: string
  endDate?: string
  page: number
  pageSize: number
}

export interface User {
  id: string
  username: string
  name: string
  token: string
}

// 最近活动类型定义
export interface RecentActivity {
  action: string
  count: number
  operationTime: string
  sampleNumber?: string
  operator: string
}

export interface ApiResponse<T> {
  success: boolean
  message: string
  data?: T
}

export interface LoginRequest {
  username: string
  password: string
}

// 接口已在上方定义，删除重复定义

export interface SampleGroup {
  type: "unassigned" | "mixed-only" | "complete"
  samplingNumber?: string
  mixedNumber?: string
  samples: Sample[]
  id: string
}

export interface ExportRequest {
  startDate: string
  endDate: string
  status?: "all" | "unassigned" | "mixed-only" | "complete"
  format: "excel" | "pdf"
}
